<template>
  <div class="member">
    <el-table :data="list" stripe :header-cell-style="{background: '#fafafa', color:　'#000'}"
      height="calc(100% - 50px)">
      <el-table-column align="center" label="序号" width="150">
        <template slot-scope="scope">
          <div>{{scope.$index + 1}}</div>
        </template>
      </el-table-column>
      <el-table-column align="center" label="姓名" prop="userName"></el-table-column>
      <el-table-column align="center" label="参与项目" prop="projectCount"></el-table-column>
      <el-table-column align="center" label="参与任务" prop="taskCount"></el-table-column>
    </el-table>
    <div class="pagination">
      <el-pagination background layout="prev, pager, next" :current-page="current" :page-size="size" :total="total"
        @current-change="pageChange"></el-pagination>
    </div>
  </div>
</template>
<script>
  import httpSer from "@/http"
  export default {
    props: {
      searchVal: String
    },
    data() {
      return {
        list: [],
        size: 13,
        total: 0,
        current: 1,
        postData: {
          userName: ''
        }
      };
    },
    created() { },
    mounted() {
      this.getMemberList()
    },
    methods: {
      getMemberList() {
        let url = "/userInfo/userInfoStatistics";
        let data = {
          size: this.size,
          current: this.current
        };
        // Object.assign(data, this.postData);
        httpSer.post(url, data).then(res => {
          let list = res.records;
          this.list = list;
          this.total = res.total * 1;
          this.current = res.current * 1;
        });
      },
      pageChange(current) {
        this.current = current * 1;
        this.getMemberList();
      },
    },
    watch: {
      // searchVal(newVal, oldVal) {
      //   //搜索
      //   this.postData.userName = newVal
      //   this.current = 1;
      //   this.getMemberList()
      // }
    },
    filters: {},
    components: {}
  };
</script>

<style lang="less" scope>
  @import "./index.less";
</style>